
import 'package:flutter/cupertino.dart';

//视频加载中动画
class LoadidngVideoAnimateWidget extends ImplicitlyAnimatedWidget{

  LoadidngVideoAnimateWidget({
    Key? key,
    required this.decoration,
    required this.child,
    Curve curve = Curves.linear,
    required Duration duration,
  }) : super(key: key,
    curve: curve,
    duration: duration,);

  final BoxDecoration decoration;
  final Widget child;

  @override
  AnimatedWidgetBaseState createState() => _LoadidngVideoAnimateSatate();

}

class  _LoadidngVideoAnimateSatate  extends AnimatedWidgetBaseState<LoadidngVideoAnimateWidget>{

  late DecorationTween _decoration;

  @override
  Widget build(BuildContext context) {
   
     return DecoratedBox(
       decoration: _decoration.evaluate(animation),
       child: widget.child,
     );
  }

  @override
  void forEachTween(TweenVisitor<dynamic> visitor) {
    _decoration = visitor(
      _decoration,
      widget.decoration,
          (value) => DecorationTween(begin: value),
    ) as DecorationTween;
  }


}